﻿<%@ Page Language="C#" ValidateRequest="false" MasterPageFile="~/Include/Admin.master"
    AutoEventWireup="true" CodeFile="AddProduct.aspx.cs" Inherits="Admin_Product_AddProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link type="text/css" href="/kindeditor/themes/default/default.css" />
    <script type="text/javascript" charset="utf-8" src="/kindeditor/kindeditor.js"></script>
    <script type="text/javascript" charset="utf-8" src="/kindeditor/lang/zh_CN.js"></script>
    <script type="text/javascript">
        var editor1;
        KindEditor.ready(function (K) {
            editor1 = K.create('#<%=txtJieShao.ClientID %>', {
                cssPath: '/kindeditor/plugins/code/prettify.css',
                uploadJson: '/kindeditor/asp.net/upload_json.ashx',
                fileManagerJson: '/kindeditor/asp.net/file_manager_json.ashx',
                allowFileManager: true,
                afterCreate: function () {
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="text-align: center">
        <table cellspacing="0" cellpadding="0" style="width: 100%; height: 30px; padding-bottom: 5px;
            border: 1px; border-color: #66CCFF;">
            <tr style="background-image: url('/images/管理员页面/title_bg1.jpg'); background-repeat: repeat-x;">
                <td style="font-weight: bold; font-size: large; font-family: 仿宋;">
                    <strong class="style1">商品添加</strong>
                </td>
            </tr>
        </table>
        <asp:Literal ID="litMessage" runat="server"></asp:Literal>
        <asp:ValidationSummary ID="vsWrong" DisplayMode="List" ShowSummary="true" runat="server"
            ValidationGroup="Add" />
        <h4 style="text-align: left">
            <a href="Manage.aspx">返回管理页面</a>
        </h4>
        <table style="width: 100%; margin-bottom: 0px;" class="editTable">
            <tr>
                <th class="style3">
                    产品编号
                </th>
                <td>
                    <asp:Label ID="lblCPNH" runat="server" Text=""></asp:Label>
                </td>
                <th class="style4">
                     <span class="red">*</span>产品主分类
                </th>
                <td class="style5">
                    <asp:DropDownList ID="drpZhuFenLei" runat="server" Height="22px" Width="200px" OnTextChanged="drpZhuFenLei_TextChanged"
                        AutoPostBack="true">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" InitialValue="0" runat="server"
                        ErrorMessage="请选择产品主分类" ValidationGroup="Add" ControlToValidate="drpZhuFenLei">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th class="style3">
                     <span class="red">*</span>产品次分类
                </th>
                <td class="style5">
                    <asp:DropDownList ID="drpCiFenLei" runat="server" Height="22px" Width="200px" OnTextChanged="drpCiFenLei_TextChanged"
                        AutoPostBack="true">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" InitialValue="0" runat="server"
                        ErrorMessage="请选择产品次分类" ValidationGroup="Add" ControlToValidate="drpCiFenLei">*</asp:RequiredFieldValidator>
                </td>
                <th class="style4">
                     <span class="red">*</span>产品分类
                </th>
                <td>
                    <asp:DropDownList ID="drpFenLei" runat="server" Height="22px" Width="200px">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" InitialValue="0" runat="server"
                        ErrorMessage="请选择分类" ValidationGroup="Add" ControlToValidate="drpFenLei">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th class="style3">
                     <span class="red">*</span>产品名称
                </th>
                <td class="style5">
                    <asp:TextBox ID="txtTitle" runat="server" Height="22px" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="请输入产品名称"
                        ControlToValidate="txtTitle" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
                <th class="style4">
                     <span class="red">*</span>价格
                </th>
                <td>
                    <asp:TextBox ID="txtJiaGe" runat="server" Height="22px" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="请输入产品价格"
                        ControlToValidate="txtJiaGe" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th class="style3">
                     <span class="red">*</span>产品积分
                </th>
                <td class="style5">
                    <asp:TextBox ID="txtJiFen" runat="server" Height="22px" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请输入产品积分"
                        ControlToValidate="txtJiFen" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
                <th class="style4">
                     <span class="red">*</span>市场价
                </th>
                <td>
                    <asp:TextBox ID="txtShiChangJia" runat="server" Height="22px" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入市场价"
                        ControlToValidate="txtShiChangJia" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th class="style3">
                    品牌
                </th>
                <td class="style5">
                    <asp:DropDownList ID="drpPinPai" runat="server" Height="22px" Width="200px">
                    </asp:DropDownList>
                </td>
                <th class="style4">
                     <span class="red">*</span>产品数量
                </th>
                <td>
                    <asp:TextBox ID="txtCount" runat="server" Height="22px" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="请输入产品数量"
                        ControlToValidate="txtCount" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th class="style3">
                    购买等级
                </th>
                <td class="style5">
                    <asp:DropDownList ID="drpLevel" runat="server" Height="22px" Width="200px">
                    </asp:DropDownList>
                </td>
                <th class="style4">
                    支付方式
                </th>
                <td>
                    <asp:DropDownList ID="drpPayType" runat="server" Height="22px" Width="200px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <th class="style3">
                     <span class="red">*</span>商品介绍
                </th>
                <td colspan="3">
                    <asp:TextBox ID="txtJieShao" runat="server" Width="700px" Height="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="请输入商品介绍"
                        ControlToValidate="txtJieShao" ValidationGroup="Add">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    商品图片
                </th>
                <td colspan="3">
                    <div style="width: 700px; float: left">
                        <asp:Repeater ID="rptTuPian" runat="server" OnItemCommand="rptTuPian_ItemCommand">
                            <ItemTemplate>
                                <div style="width: 100px; height: 120px; float: left">
                                    <div style="width: 100px; height: 100px">
                                        <img alt='产品图片' src="/Resource/Product/<%#Eval("ImgSrc") %>" width="100px" height="100px" />
                                    </div>
                                    <asp:LinkButton ID="linkbtDeleteTuPian" runat="server" ForeColor="Red" CommandName="Delete"
                                        CommandArgument='<%#Eval("ID") %>'>删除</asp:LinkButton>
                                </div>
                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                    <div style="width: 200px; float: left">
                        <asp:FileUpload ID="fuTuPian" runat="server" />
                        <asp:Button ID="btnTiJiao" runat="server" Text="上传" OnClick="btnTiJiao_Click" ValidationGroup="Add" />
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <input id="sumbit" type="button" value="提交" />
                    <asp:Button ID="btnSubmit" runat="server" Style="display: none" Text="提交" OnClick="btnSubmit_Click"
                        Height="20px" Width="50px" ValidationGroup="Add" />
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#sumbit").click(function () {
                editor1.sync('editor_id');
                $("#<%=btnSubmit.ClientID %>").click();
            })
        })     
    </script>
</asp:Content>
